package com.lening.community.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lening.community.dto.CarAreaDto;
import com.lening.community.pojo.CarArea;
import com.lening.community.vo.CarAreaVo;
import com.lening.community.vo.ShopsVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @ToDo:
 * @Author：潘万法
 * @date: 2024/6/3 16:55
 */
public interface CarAreaMapper extends BaseMapper<CarArea> {
    Page<CarArea> page(CarAreaDto carAreaDto);

    /**
     * 导入
     *
     * @return
     */
    @Select("select * from car_area")
    List<CarArea> find();
    @Insert("INSERT into car_area(pid,community_id,garage_name_id,parking_space,parking_space_num,parking_space_statu,parking_space_area_id,garage_area,garage_type," +
            "satart_num,finsh_num,on_name,delete_id,yid,remarks) VALUES(#{pid},#{communityId},#{garageNameId},#{parkingSpace},#{parkingSpaceNum},#{parkingSpaceStatu},#{parkingSpaceAreaId},#{garageArea},#{garageType}," +
            "#{satartNum},#{finshNum},#{onName},#{deleteId},#{yid},#{remarks})")
    int insert(CarArea carArea);

    /**
     * 详情
     * @param pid
     * @return
     */
    CarAreaVo getById(Long pid);

    /**
     * 查询车位数量
     * @return
     */
    int getCount();
}
